import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [

    {
      path: '/',
      name: '首页',
      meta: {
        icon: 'Setting',
        parent: true,
      },
      redirect: '/index',
      component: () => import('../view/Layout.vue'),
      children: [
        {
          path: '/index',
          name: '主页',
          meta: {
            icon: 'Home'
          },
          component: () => import('../view/Index.vue'),
        },
      ]
    },
    {
      path: '/personnel',
      name: '人员管理',
      meta: {
        icon: 'Setting',
        parent: true,
      },
      redirect: '/personnel/load',
      component: () => import('../view/Layout.vue'),
      children: [
        {
          path: '/personnel/load',
          name: '人员负载',
          meta: {
            icon: 'Setting'
          },
          component: () => import('../view/personnel/PersonnelLoad.vue'),
        },
        {
          path: '/personnel/working/hours',
          name: '人员工时',
          meta: {
            icon: 'Setting'
          },
          component: () => import('../view/personnel/PersonnelWorkingHours.vue'),
        },
      ]
    },
    {
      path: '/task',
      name: '任务管理',
      meta: {
        icon: 'Setting',
        parent: true,
      },
      redirect: '/task/daily',
      component: () => import('../view/Layout.vue'),
      children: [
        {
          path: '/task/daily',
          name: '每日任务项',
          meta: {
            icon: 'Setting'
          },
          component: () => import('../view/task/TaskDaily.vue'),
        },
      ]
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      meta: {
        hidden: true,
      },
      component: () => import('../view/NotFound.vue')
    },
  
  ]
  
  
  const router = createRouter({
    history: createWebHashHistory(),
    routes,
  })
  
  export default router;